var app = getApp();
var baseUrl = app.globalData.host;
Component({
  data: {
    invstgSitus: ["授信额度测算","自定义授信额度测算"],
    invstgSituIndex:'',
    customIs:true,
    nonCustomIs:true,
    inputIs:true,
  },
  methods: {
  formInputChange(e) {
    const {field} = e.currentTarget.dataset;
    this.setData({
        [`formData.${field}`]: e.detail.value
    })
  },
  bindBusinesInvstgSitu: function(e) {
    console.log('picker country 发生选择改变，携带值为', e.detail.value);
    let customIs = true;
    let nonCustomIs = true;
    let inputIs =  false;
    if(e.detail.value === '0'){
      customIs= false;
      inputIs = false;
    }
    if(e.detail.value === '1'){
      nonCustomIs = false;
      inputIs = false;
    }
    this.setData({
      invstgSituIndex: e.detail.value,
      [`formData.invstgSituIndex`]: e.detail.value,
      customIs:customIs,
      nonCustomIs:nonCustomIs,
      inputIs:inputIs,
    })
  },
    submitForm: function() {
      var data = this.data.formData;
      console.info(data);
      this.setData({
          disabled:true
      });
      },

    onLoad: function(option) {
      var that = this;
      that.setData({
        custId:option.custId,
          [`formData.custId`]: option.custId
      });
      var data = that.data.formData;  
    }
  }
});